<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class Article extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'value' => 'required',
            'name' => 'required',
            'type_id' => 'required',
        ];
    }

    /**
     *
     *
     * @return array
     */
    public function messages()
    {
        return [
            'value.required' => '值是必须的',
            'name.required' => '接口名称是必须的',
            'name.unique' => '接口名称已经存在',
            'type_id.required' => '接口分类是必须的',
        ];
    }

}
